﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection.Emit;
using Nova.Parsing;

namespace Nova.Engine.Recompiler
{
    public abstract class CILCompiler<TNovaConstruct> : IDisposable
    {
        private bool m_IsDisposed = false;

        public abstract bool Compile(ILGenerator generator, NovaConstruct construct, ObjectMap objectMap);

        public virtual void Dispose(bool disposing)
        {
            if (!m_IsDisposed)
            {
                if (disposing)
                {
                    // .NET objects
                }

                // Unmanaged objects
            }
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
    }
}
